<template>
  <!-- home下的首页 -->
    <div class="first-page">
        <div class="first-banner">
            <MySwiper :imgs="imgs" />
        </div>
        <main>
            <div class="page">
                <div class="first-introduction">
                    <Title title="产品展示" text="Product Display"/>
                </div>
                <div class="second-banner">
                    <p>
                        <span v-for="(va,index) in product" 
                        :key="va"
                        :class="{'active':curindex==index}"
                        @click="change(index)"
                        >{{va}}</span>
                    </p>
                    <div class="product-img">
                        <p v-for="val in productImg[curindex]" :key="val"><img :src="val" alt=""></p>
                    </div>
                    <button class="btn">查看更多</button>
                </div>
                <div class="health-service">
                    <Title title="健康服务" text="Health Service"/>
                    <div class="health-item">
                        <ul>
                            <li>
                                <p><img src="../../img/firstimg/b-j.png" alt=""></p>
                                <h3>健康管理</h3>
                                <div class="health-desc">   
                                    <b></b>                             
                                    <span>健康基础数据</span>
                                    <span>健康体检报告</span>
                                    <span>中医调理方案</span>
                                </div>
                            </li>
                            <li>
                                <p><img src="../../img/firstimg/b-yaoxiang.png" alt=""></p>
                                <h3>医疗服务</h3>
                                <div class="health-desc">   
                                    <b></b>                             
                                    <span>线上轻问诊</span>
                                    <span>线下深度诊疗</span>
                                </div>
                            </li>
                            <li>
                                <p><img src="../../img/firstimg/b-yiyao.png" alt=""></p>
                                <h3>体安健康中心</h3>
                                <div class="health-desc">  
                                    <b></b>                             
                                    <span>广州</span>
                                    <span>武汉</span>
                                </div>
                            </li>
                            <li>
                                <p><img src="../../img/firstimg/b-老人.png" alt=""></p>
                                <h3>五行养老胜地</h3>
                                <div class="health-desc">  
                                    <b></b>                             
                                    <span>莲花山第一温泉水系康养胜地</span>
                                    <span>仙集大健康木系康养胜地</span>
                                    <span>大余丫山土地系康养胜地</span>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <button class="btn">查看更多</button>
                </div>
                <div class="news">
                    <Title title="新闻资讯" text="News"/>
                    <div class="news-text">
                        <div class="news-left">
                            <img src="../../img/firstimg/new-bg.png" alt="">
                        </div>
                        <div class="news-right">
                            <div class="news-time">
                                <p>
                                    <span class="news-date">12-20</span>
                                    <span>2020</span>
                                </p>
                                <p>
                                    <span class="news-date">12-20</span>
                                    <span>2020</span>
                                </p>
                            </div>
                            <div class="news-desc">
                                <div class="news-up">
                                    <h2>强强联手！广州健康集团与广东省中药研究所达成战略共识</h2>
                                    <p>广州健康信息产业有限公司与广东省中药研究所举行了合作签约仪式，广州健康信息产业有限公司董事长谢园缘、广东省中药研究所中心主任孔祥词代表双方在合作协议上签字</p>
                                </div>
                                <div class="news-down">
                                    <h2>强强联手！广州健康集团与广东省中药研究所达成战略共识</h2>
                                    <p>广州健康信息产业有限公司与广东省中药研究所举行了合作签约仪式，广州健康信息产业有限公司董事长谢园缘、广东省中药研究所中心主任孔祥词代表双方在合作协议上签字</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <footer>
            <div class="contact page">
                <div class="con-left">
                    <div class="con-up">
                        <h1>联系我们</h1>
                        <p>Contact us</p>
                    </div>
                    <div class="con-down">
                        <p>
                            <img src="../../img/firstimg/phone.png" alt="">
                            <span>电话</span>
                            <span>+400-1234-1234</span>
                        </p>
                        <p>
                            <img src="../../img/firstimg/e.png" alt="">
                            <span>邮箱</span>
                            <span>123456789@qq.com</span>
                        </p>
                        <p>
                            <img src="../../img/firstimg/weixin.png" alt="">
                            <span>微信</span>
                            <span>123-1234-5678</span>
                        </p>
                        <p>
                            <img src="../../img/firstimg/dingwei.png" alt="">
                            <span>广州市黄埔区科学域科学大道科汇三街4号401房</span>
                        </p>
                    </div>
                </div>
                <div class="con-right">
                    <!-- <input type="text" placeholder="名字">
                    <input type="text" placeholder="邮箱">
                    <input type="text" placeholder="电话">
                    <textarea placeholder="内容"></textarea>
                    <button>提交</button> -->
                    <el-form :model="ruleForm" ref="ruleForm" class="demo-ruleForm"> 
                        <el-form-item
                            prop="user"
                            :rules="[
                                { required: true, message: '用户名不能为空', trigger: 'blur' }
                            ]"                  
                        >
                            <el-input type="text" placeholder="名字"
                                v-model="ruleForm.user">
                            </el-input>
                        </el-form-item>
                        <el-form-item prop="email" 
                            :rules="[
                            { required: true, message: '请输入邮箱地址', trigger: 'blur' },
                            { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
                            ]">
                                <el-input type="email" placeholder="邮箱" v-model="ruleForm.email" ></el-input>
                        </el-form-item>
                        <el-form-item
                            prop="pass"
                            :rules="[
                                { required: true,message: '电话号不能为空'},
                                {type:'number',message: '电话号码必须是数字'}
                            ]"
                        >
                            <el-input type="pass" placeholder="电话" 
                                v-model.number="ruleForm.pass">
                            </el-input>
                        </el-form-item>
                        <el-form-item prop="desc"
                            :rules="[
                                { required: true, message: '内容不能为空', trigger: 'blur' },
                                {max:30,message:'最多输入30个字符'}
                            ]"                  
                        >
                            <el-input type="textarea" 
                                v-model="ruleForm.desc"
                                placeholder="内容"
                            >
                            </el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button class="btn" type="primary" @click="submitForm">提交</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </div>  
        </footer>                         
    </div>
</template>

<script>
import MySwiper from '../../components/MySwiper'
import Title from '../../components/Title'
import img1_1 from '../../img/firstimg/banner1.jpg'//引入轮播图所需要的图片
import img1_2 from '../../img/firstimg/banner2.jpg'//引入轮播图所需要的图片
import img1_3 from '../../img/firstimg/banner3.jpg'//引入轮播图所需要的图片
import img2_1 from '../../img/firstimg/1.jpg'//引入产品展示图片
import img2_2 from '../../img/firstimg/2.jpg'
import img2_3 from '../../img/firstimg/3.jpg'
import img2_4 from '../../img/firstimg/4.jpg'
import img3_1 from '../../img/firstimg/5.jpg'
import img3_2 from '../../img/firstimg/6.jpg'
import img3_3 from '../../img/firstimg/7.jpg'
import img3_4 from '../../img/firstimg/8.jpg'
import img4_1 from '../../img/firstimg/9.jpg'
import img4_2 from '../../img/firstimg/10.jpg'
import img4_3 from '../../img/firstimg/11.jpg'
import img4_4 from '../../img/firstimg/12.jpg'

export default {
    components:{
        MySwiper,
        Title
    },
    data(){
        return {
            imgs:[img1_1,img1_2,img1_3],//轮播图图片
            product:['智能穿戴','净化产品','药食产品'],
            productImg:[[img2_1,img2_2,img2_3,img2_4],[img3_1,img3_2,img3_3,img3_4],[img4_1,img4_2,img4_3,img4_4]],//产品展示图片
            curindex:0,
            ruleForm: {
                pass: '',
                user: '',
                email:'',
                desc:''
            },
        }
    },
    methods:{
        change(i){
            this.curindex=i;
        },
        submitForm(){
            console.log('提交时调用的函数')
        }
    }
}
</script>

<style lang='scss' scoped>
.first-page{
    width: 100%;
}
.first-banner{
    width: 100%;
    margin-bottom: 50px;
}
main{
    width: 100%;
    position: relative;
    z-index: 4;
    background: #2b45a4;
    &::before, &::after{
        content: "";
        position: absolute;
        width: 120%;
        height: 200px;
        border-radius: 50%;
        left: -10%;
        background:  #2b45a4;
        z-index: -1;
    }
    &::before{
        top: -150px;
    }
    &::after{
        bottom: -150px;
    }
}
.second-banner{
    width: 100%;
    margin-top: 84px;
    p{
        width: 100%;
        display: flex;
        justify-content: center;
        span{
            width: 138px;
            height: 49px;
            font-size: 20px;
            background: #4867d9;
            text-align: center;
            line-height: 50px;
            color: #b9c8ff;
            margin-right: 10px;
            border-radius: 2px;
            cursor: pointer;
        }
        .active{
            background: #446cfe;
            color: white;
        }
    }
    .btn{
        display: block;
        width: 220px;
        height: 48px;
        font-size: 20px;
        background: #446cfe;
        color: white;
        margin:0 auto;
        margin-top: 124px;
        outline: none;
        border: none;
        cursor: pointer;
        border-radius: 5px;
        &:hover{
            background: crimson;
        }
    }
}
.product-img{
    width: 100%;
    height: 400px;
    display: flex;
    margin-top: 66px;
    p{
        width: 100%;
        img{
            width: 310px;
            height: 372px;
            margin-right: 20px;
        }      
    }
}
.health-service{
    margin-top:128px;
    .btn{
        display: block;
        width: 220px;
        height: 48px;
        font-size: 20px;
        background: #446cfe;
        color: white;
        margin:0 auto;
        margin-top: 124px;
        outline: none;
        border: none;
        cursor: pointer;
        border-radius: 5px;
        &:hover{
            background: crimson;
        }
    }
}
.health-item{
    width: 100%;
    ul{
        display: flex;
        justify-content: space-between;
        li{
            width: 260px;
            display: flex;
            flex-direction: column;
            position: relative;
            color: white;
            cursor: pointer;
            p{
                width: 200px;
                height: 200px;
                margin: 0 auto;
                background: #446cfe;
                border-radius: 50%;
                display: flex;
                justify-content: center;
                align-items: center;
            }
            p:hover{
                background: #839eff;
            }
            h3{
                font-size: 36px;
                // margin-bottom: 28px;
                text-align: center;
                line-height: 120px;
            }
            .health-desc{
                width: 260px;
                height: 150px;
                margin: 0 auto;
                position: relative;
                // top: 260px;
                line-height: 40px;
                // margin-top: 42px;
                text-align: center;
                padding: 10px 0;
                font-size: 18px; 
                border: 1px solid #4867d9;               
                span{
                    display: block;
                    // margin-top: 12px;
                }
                b{
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 2px;
                    opacity: 0;
                    transition: opacity 0.3s linear;
                    background: radial-gradient(circle, #fff, #839eff,#2b45a4);
                }
            }
            p:hover~.health-desc b{
                opacity: 1;
            }
        }
    }
}
.news{
    width: 100%;
    margin-top: 182px;
    
}
.news-text{
    width: 100%;
    display: flex;
    margin-top: 90px;
    background: #446cfe;
    height: 390px;
    overflow: hidden;
    .news-left{
        width: 560px;
        height: 390px;
        padding: 8px;
        padding-right: 20px;
        flex-shrink: 0;
        img{
            width: 100%;
            height: 100%;
        }
    }
    .news-right{
        flex: 1;
        padding: 10px;
        display: flex;
        overflow: hidden;
    }
    .news-time{
        width: 130px;
        height: 100%;
        display: flex;
        flex-shrink: 0;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        padding-right: 10px;
        p{
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            span{
                margin-top: 14px;
                font-size: 20px;
                color: white;
            }
            .news-date{
                font-size: 30px;
            }
        }
    }
    .news-desc{
        flex: 1;
        padding-top: 16px;
        color: white;
        .news-down{
            margin-top: 50px;
        }
        .news-up, .news-down{
            width: 100%;
            h2{
                width: 550px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                font-size: 24px;
                font-weight: bold;
                margin-bottom: 10px;
            }
            p{
                font-size: 18px;
                margin-top: 10px;
                line-height: 32px;
                text-align: justify;
                padding-right: 30px;
                opacity: 0.8;
            }
        }
    }
}
footer{
    width: 100%;
    background: #4867d9;
    padding-top: 280px;
}
.contact{
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding-right: 160px;
    padding-bottom: 200px;
    .con-left{
        width: 480px;
        height: 330px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-left: 50px;
        .con-up{
            h1{
                font-size: 38px;
                font-weight: bold;
                color: white;
            }
            p{
                font-size: 20px;
                font-weight: bold;
                color: white;
                margin-top: 10px;
            }
        }
        .con-down{
            margin-top: 14px;
            p{
                display: flex;
                align-items: center;
                margin-top: 16px;
                img{
                    width: 20px;
                }
                span{
                    font-size: 18px;
                    margin-left: 10px;
                    color: white;
                }
            }
        }
    }
    .con-right{
        width: 440px;
        height: 330px;
        display: flex;
        flex-direction: column;
        .demo-ruleForm{
            width: 100%;
            height: 100%;
        }
        .el-form-item{
            margin-bottom: 30px;
        }
        /deep/ .el-form-item__error{
            font-size: 18px;
        }
        /deep/ input{
            background: #2b45a4 ;
            outline: none;
            border: none;
            color: white;
            &::placeholder{
                color: #a8b3ea;
                font-size: 16px;
            }
        }
        /deep/ textarea{
            height: 120px;
            resize: none;
            background: #2b45a4;
            outline: none;
            border: none;
            padding: 10px;
            color: #fff;
            font-size: 20px;
            &::placeholder{
                color: #a8b3ea;
                font-size: 18px;
            }
        }
        /deep/ button{
            width: 100%;
            height: 50px;
            margin-top: 10px;
            background: #839eff;
            outline: none;
            border: none;
            color: white;
            font-size: 20px;
            cursor: pointer;
            border-radius: 5px;
            &:hover{
                background: crimson;
            }
        }
    }
}
</style>
